package com.leo.service.impl;

import com.leo.base.redis.util.RedisUtil;
import com.leo.service.IRedisService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ClassName RedisServiceImpl
 * @Description
 * @Author wangss
 * @date 2020.09.21 17:42
 * @Version 1.0
 */
@Service
public class RedisServiceImpl implements IRedisService {


    @Resource
    private RedisUtil redisUtil;

    @Override
    public void add() {
        redisUtil.set("k1", "v1", 30);
    }

    @Override
    public String get(String key) {
        return (String) redisUtil.get(key);
    }

    @Override
    public void addString() {
        redisUtil.set("k2", "v2");
    }

    @Override
    public void addStringRedis() {
        redisUtil.set("k3", "v3");
    }

}
